home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / perl5 / auto / RPC / XML / Server / get_method.al < prev    next >
Encoding:
Text File  |  2008-11-04  |  1.2 KB  |  39 lines

  1. # NOTE: Derived from blib/lib/RPC/XML/Server.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package RPC::XML::Server;
  5.  
  6. #line 1170 "blib/lib/RPC/XML/Server.pm (autosplit into blib/lib/auto/RPC/XML/Server/get_method.al)"
  7. sub get_method
  8. {
  9.     my $self = shift;
  10.     my $name = shift;
  11.  
  12.     my $meth = $self->{__method_table}->{$name};
  13.     unless (defined $meth)
  14.     {
  15.         if ($self->{__auto_methods})
  16.         {
  17.             # Try to load this dynamically on the fly, from any of the dirs
  18.             # that are in this object's @xpl_path
  19.             (my $loadname = $name) =~ s/^system\.//;
  20.             $self->add_method("$loadname.xpl");
  21.         }
  22.         # If method is still not in the table, we were unable to load it
  23.         return "Unknown method: $name"
  24.             unless $meth = $self->{__method_table}->{$name};
  25.     }
  26.     # Check the mod-time of the file the method came from, if the test is on
  27.     if ($self->{__auto_updates} && $meth->{file} &&
  28.         ($meth->{mtime} < (stat $meth->{file})[9]))
  29.     {
  30.         my $ret = $meth->reload;
  31.         return "Reload of method $name failed: $ret" unless ref($ret);
  32.     }
  33.  
  34.     $meth;
  35. }
  36.  
  37. # end of RPC::XML::Server::get_method
  38. 1;
  39.